package ar.edu.isft189.controller;

import java.sql.SQLException;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import ar.edu.isft189.utility.DBUtility;

@WebListener
public class AppListener  implements ServletContextListener{

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		try {
			DBUtility.getConnection().close();
			System.out.println("Me desconecte");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		
		DBUtility.getConnection();
		
		System.out.println("Me conecte 2");
		
	}

}
